import { createRouter, createWebHistory } from 'vue-router'
import LayOut from '../views/LayOut.vue'
import HomePage from '../views/HomePage.vue'
import HomePageMain from '../views/HomePageMain.vue'
import MarketPrice from '../views/MarketPrice.vue'
import Home from '../views/Home.vue'
import Inquiry from '../views/Inquiry.vue'
import Perchase from '../views/Perchase.vue'
import Selective from '../views/Selective.vue'
import Consult from '../views/Consult.vue'
import DigitalI from '../views/DigitalI.vue'
import Brands from '../views/Brands.vue'
import Person from '../views/Person.vue'
import Share from '../views/Share.vue'
import NewShare from '../views/NewShare.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import DataBaseLayout from '../views/DataBase/DataBaseLayout.vue'
import DataBaseHomepage from '../views/DataBase/DatabaseHomepage.vue'
import DataBaseHome from '../views/DataBase/DatabaseHome.vue'
import Report from '../views/DataBase/report.vue'
import Run from '../views/DataBase/run.vue'

import InquiryHomepage from '../views/InquiryHomepage.vue'
import NewInquiry from '../views/NewInquiry/NewInquiry.vue'
import InquiryQuote from '../views/InquireQuote/InquireQuote.vue'
import HistoricalRFQs from '../views/HistoricalRFQs/HistoricalRFQs.vue'
import CaseStudy from '../views/CaseStudy/CaseStudy.vue'
import InquireQuote from '../views/InquireQuote/InquireQuote.vue'

import Publish from '../views/SelectiveSubPages/Publish.vue'
import Example from '../views/SelectiveSubPages/Example.vue'
import SupplierDetail from '../views/BrandsSubPages/SupplierDetail.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: LayOut,
          children: [
            {
              path: '/',
              name: 'home',
              component: HomePageMain,
            //   children:[{
            //     path:'/',
            //     name: 'r1',
            //     component: Report
            //   },
            //   {
            //     path:'r2',
            //     name:'r2',
            //     component: Run
            //   }
            // ]
            },
            {
              path: '/marketprice',
              name: 'marketprice',
              component: MarketPrice
            },
            {
              path: '/inquiry',
              name: 'inquiry',
              component: InquiryHomepage,
              
            },
            {
              path: '/perchase',
              name: 'perchase',
              component: Perchase
            },
            {
              path: '/selective',
              name: 'selective',
              component: Selective
            },
            {
              path: '/consult',
              name: 'consult',
              component: Consult
            },
            {
              path: '/digital',
              name: 'digital',
              component: DigitalI
            },
            {
              path: '/brands',
              name: 'brands',
              component: Brands
            },    
            {
              path: '/newshare',
              name: 'newshare',
              component: NewShare
            },
            // }
            //   path: '/share',
            //   name: 'share',
            //   component: Share
            // },
            {
              path:'/newinquiry',
              name:'newinquiry',
              component:NewInquiry
            },
            {
              path:'/inquiryquote',
              name:'inquiryquote',
              component:InquiryQuote
            },
            {
              path:'/historicalrfqs',
              name:'historicalrfqs',
              component:HistoricalRFQs
            },
            {
              path:'/casestudy',
              name:'casestudy',
              component:CaseStudy
            },
            {
              path:'/inquirequote',
              name:'inquirequote',
              component:InquireQuote
            },
            {
              path: '/example',
              name: 'example',
              component: Example,
              
              props(route){
                return route.query
              }
            },
            {
              path: '/supplierDetail',
              name: 'supplierDetail',
              component: SupplierDetail,

              props(route){
                return route.query
              }
            },
            {
              path: '/publish',
              name: 'publish',
              component: Publish
            }
          ]
          // children: [
          //   {
          //     path: '/',
          //     name: 'home',
          //     component: Home
          //   },
          //   {
          //     path: '/marketprice',
          //     name: 'marketprice',
          //     component: MarketPrice
          //   },
          //   {
          //     path: '/inquiry',
          //     name: 'inquiry',
          //     component: Inquiry
          //   },
          //   {
          //     path: '/perchase',
          //     name: 'perchase',
          //     component: Perchase
          //   },
          //   {
          //     path: '/selective',
          //     name: 'selective',
          //     component: Selective
          //   },
          //   {
          //     path: '/consult',
          //     name: 'consult',
          //     component: Consult
          //   },
          //   {
          //     path: '/digital',
          //     name: 'digital',
          //     component: DigitalI
          //   },
          //   {
          //     path: '/brands',
          //     name: 'brands',
          //     component: Brands
          //   },            {
          //     path: '/share',
          //     name: 'share',
          //     component: Share
          //   }

          // ]
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    {
      path: '/person',
      name: 'person',
      component: Person
    },
    {
      path: '/database',
      name: 'database',
      component: DataBaseLayout,
      children: [
        {
          path: '/is',
          name: 'databaseHomepage',
          component: DataBaseHomepage,
          children: [
            {
              path: '/ass',
              name: 'databaseHome',
              component: Home
            }
          ]
        }
      ]
    }
    
  ]
})

export default router
